package com.ruoyi.system.service.shopping.impl;

import com.ruoyi.system.domain.shopping.Address;
import com.ruoyi.system.mapper.shopping.AddressMapper;
import com.ruoyi.system.service.shopping.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AddressServiceImpl implements AddressService {
    @Autowired
    private AddressMapper addressMapper;
    @Override
    public Boolean insertAddress(Address address) {
        int i = addressMapper.insertAddress(address);
        return i>0;
    }

    @Override
    public Boolean updateAddress(Address address) {
        int i = addressMapper.updateAddress(address);
        return i>0;
    }

    @Override
    public List<Address> selectList(Integer userId) {
        return addressMapper.selectList(userId);
    }

    @Override
    public Boolean deleteAddress(Integer userId, Integer addressId) {
        int i = addressMapper.deleteAddress(userId, addressId);
        return i>0;
    }
}
